package com.ebocy.hammer.battle.fight.message;

import com.ebocy.hammer.core.constants.GameMessageCode;
import com.ebocy.hammer.core.domain.GamePlayer;
import com.ebocy.hammer.core.message.AbstractS2CMessage;

public class S2CWormUpMessage extends AbstractS2CMessage{
	String playerId;
	short x;
	short y;

	public S2CWormUpMessage(GamePlayer gamePlayer){
		this.playerId = String.valueOf(gamePlayer.getGamePlayerId());
		this.x = gamePlayer.getX();
		this.y = gamePlayer.getY();
	}
	@Override
	protected void writeMessage() {
		writeString(playerId);
		writeShort(x);
		writeShort(y);
	}

	@Override
	public short getMessageCode() {
		return GameMessageCode.BATTLE_WORMUP;
	}

}
